package com.molichuxing.services.property;

/**
 * 
 * @author liyg 驾驶证验证状态枚举类
 *
 */
public enum DrivingLicenseStatusEnum {

	/**
	 * 验证失败
	 */
	VERIFY_FAILURE(0, "验证失败"),
	
	/**
	 * 验证通过
	 */
	VERIFY_PASS(1, "验证通过"),

	/**
	 * 待验证
	 */
	WAIT_PASS(2, "待验证");

	

	int value;
	String name;

	DrivingLicenseStatusEnum(int value, String name) {
		this.value = value;
		this.name = name;
	}

	public int getValue() {
		return value;
	}

	public String getName() {
		return name;
	}


	/**
	 * 通过value获取枚举的name
	 * 
	 * @param value
	 * @return
	 */
	public static String getName(int value) {
		DrivingLicenseStatusEnum enumerate = getEnum(value);
		return enumerate == null ? null : enumerate.getName();
	}

	/**
	 * 通过value获取枚举
	 * 
	 * @param value
	 * @return
	 */
	public static DrivingLicenseStatusEnum getEnum(int value) {
		for (DrivingLicenseStatusEnum enumerate : DrivingLicenseStatusEnum.values()) {
			if (enumerate.getValue() == value) {
				return enumerate;
			}
		}
		return null;
	}
}
